//microcommand define sehax45
const execa = require("execa")
signature("<text:rawtext>", {
  showWarnings: true,
  checkUnknown: true,
})
option("timestamp", "-t")
action(({ session, options: { timestamp } }, text) => {
  if (!text) return session.text(".expect-text")
  const args = ["/root/koishi-app/assets/bin/SEHAX45.py"]
  if (timestamp) args.push("--withTS")
  return execa("python3", args, {
    input: text,
    env: {
      PYTHONIOENCODING: "utf-8",
    },
  }).then(
    ({ stdout }) => h.escape(stdout),
    err => h.escape(String(err))
  )
})
locale("zh-CN", { description: "希顶太阳易哈希", usage: "输入格式：希顶语句子，可多行", options: { timestamp: "使用带时间戳的算法" }, messages: { "expect-text": "缺少文本…" } })